package com.fileshare.web.service.impl;

import com.fileshare.web.dao.CategoryRepository;
import com.fileshare.web.entity.Category;
import com.fileshare.web.service.CategoryService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CategoryServiceImpl implements CategoryService {
    @Resource
    private CategoryRepository categoryRepository;

    @Override
    public List<Category> findCategories(Integer level) {
        return categoryRepository.findAll(level);
    }

    @Override
    public Category getByName(String categoryName) {
        return categoryRepository.findByName(categoryName);
    }

    @Override
    public Category getBySeq(String categorySeq) {
        return categoryRepository.findBySeq(categorySeq);
    }
}
